package com.lcxw.hxzbapi.controller.goodnamecontroller;

import com.lcxw.hxzbapi.entity.requestBean.BuyGoodNameReq;
import com.lcxw.hxzbapi.entity.response.Response;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/goodName")
@Slf4j
public class GoodNameApiController {

    @Resource
    GoodNameRealization goodNameRealization;

    @PostMapping("/buy")
    public Response buyGoodName(@RequestBody BuyGoodNameReq buyGoodNameReq) {

        try {
            return goodNameRealization.buyGoodName(buyGoodNameReq);
        } catch (Exception e) {
            return Response.dbFail(log, "处理用户靓号");
        }
    }

}
